import { Controller, Get, UseFilters, UseGuards } from '@nestjs/common';
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { TypeormFilter } from 'src/common/filters/typeorm.filter';
import { JwtGuard } from 'src/common/guards/jwt.guard';
import { HomeService } from './home.service';
import { HomeResultVo } from './vo/home.result.vo';

@Controller('home')
@ApiTags('后台首页')
@UseFilters(new TypeormFilter())
export class HomeController {
    constructor(private readonly homeService: HomeService) {}

    @Get()
    @ApiOperation({summary:'后台首页数据'})
    @ApiResponse({type:HomeResultVo})
    @ApiBearerAuth()
    @UseGuards(JwtGuard)
    find() {
        return this.homeService.find();
    }
}
